class Wonderful {
  late int code;
  late String msg;
  late List<Data> data;

  Wonderful({required this.code, required this.msg, required this.data});

  Wonderful.fromJson(Map<String, dynamic> json) {
    code = json['code'];
    msg = json['msg'];
    if (json['data'] != null) {
      data = [];
      json['data'].forEach((v) {
        data.add(new Data.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['code'] = this.code;
    data['msg'] = this.msg;
    data['data'] = this.data.map((v) => v.toJson()).toList();
    return data;
  }
}

class Data {
  late String id;
  late String title;
  late String type;
  late int likes;
  late bool isLiked;
  late Cover cover;
  late String time;
  late int comments;
  late int collects;
  late User user;
  late double cursorScore;

  Data(
      {required this.id,
      required this.title,
      required this.type,
      required this.likes,
      required this.isLiked,
      required this.cover,
      required this.time,
      required this.comments,
      required this.collects,
      required this.user,
      required this.cursorScore});

  Data.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    title = json['title'];
    type = json['type'];
    likes = json['likes'];
    isLiked = json['isLiked'];
    cover = (json['cover'] != null ? new Cover.fromJson(json['cover']) : null)!;
    time = json['time'];
    comments = json['comments'];
    collects = json['collects'];
    user = (json['user'] != null ? new User.fromJson(json['user']) : null)!;
    cursorScore = json['cursorScore'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['title'] = this.title;
    data['type'] = this.type;
    data['likes'] = this.likes;
    data['isLiked'] = this.isLiked;
    data['cover'] = this.cover.toJson();
    data['time'] = this.time;
    data['comments'] = this.comments;
    data['collects'] = this.collects;
    data['user'] = this.user.toJson();
    data['cursorScore'] = this.cursorScore;
    return data;
  }
}

class Cover {
  late String url;
  late String gifUrl;
  late int width;
  late int height;
  late String fileId;

  Cover(
      {required this.url,
      required this.gifUrl,
      required this.width,
      required this.height,
      required this.fileId});

  Cover.fromJson(Map<String, dynamic> json) {
    url = json['url'];
    gifUrl = json['gifUrl'];
    width = json['width'];
    height = json['height'];
    fileId = json['fileId'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['url'] = this.url;
    data['gifUrl'] = this.gifUrl;
    data['width'] = this.width;
    data['height'] = this.height;
    data['fileId'] = this.fileId;
    return data;
  }
}

class User {
  late String id;
  late String image;
  late String nickname;
  late int redOfficialVerifyType;
  late bool redOfficialVerifyShowIcon;
  late bool officialVerified;

  User(
      {required this.id,
      required this.image,
      required this.nickname,
      required this.redOfficialVerifyType,
      required this.redOfficialVerifyShowIcon,
      required this.officialVerified});

  User.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    image = json['image'];
    nickname = json['nickname'];
    redOfficialVerifyType = json['redOfficialVerifyType'];
    redOfficialVerifyShowIcon = json['redOfficialVerifyShowIcon'];
    officialVerified = json['officialVerified'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['image'] = this.image;
    data['nickname'] = this.nickname;
    data['redOfficialVerifyType'] = this.redOfficialVerifyType;
    data['redOfficialVerifyShowIcon'] = this.redOfficialVerifyShowIcon;
    data['officialVerified'] = this.officialVerified;
    return data;
  }
}
